

def login(username,password):
    db_username = 'admin'
    db_password = '123456'

    # 判断用户名或密码是否为空
    if username is None or username == "":
        return {'code':1,'message':'用户名不能为空!'}
    if password is None or password == "":
        return {'code':2,'message':'密码不能为空!'}

    # 用户名和密码正确匹配
    if username == db_username and password == db_password:
        return {'code':0,'message':'登录成功'}

    return {'code':3,'message':'用户名或密码不正确!'}